<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        let user = {
            size: {
                height: 185,
                weight: 75,
            },
            set fullName(value) {
                [this.firstName, this.lastName] = value.split(" ");
            },
            get fullName() {
                return `${this.firstName} ${this.lastName}`;
            },
        };

        alert(JSON.stringify(user));

        user.fullName = "Alice Cooper";

        alert("设置后：" + JSON.stringify(user));
    </script>
</head>
<body>
<div id="root"></div>
</body>
</html>